package com.joy.web.admin.service;

import com.joy.common.model.vo.JsTreeVO;
import com.joy.web.admin.entity.CommonCd;
import com.joy.web.base.service.IBaseService;

import java.util.List;
import java.util.Optional;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author yjzhao
 * @since 2019-09-23
 */
public interface ICommonCdService extends IBaseService<CommonCd> {

    /**
     * @Description 获取数据字典 tree
     * @Author yjzhao
     * @Date 2019/9/23 14:10
     **/
    List<JsTreeVO> findAllCommonCdTree() throws Exception;

    /**
     * @Description 获取数据字典
     * @Author yjzhao
     * @Date 2019/9/23 14:10
     **/
    List<CommonCd> findAllCommonCd() throws Exception;

    /**
     * @Description 根据childCd 获取 CommonCd
     * @param childCd
     * @return
     * @Author yjzhao
     * @Date 2019/9/23 21:10
     **/
    Optional<CommonCd> findByChildCd(String childCd) throws Exception;

    /**
     * @Description 根据parentCd 获取 子节点列表
     * @param parentCd
     * @return
     * @Author yjzhao
     * @Date 2019/9/23 21:10
     **/
    List<CommonCd> findListByParentCd(String parentCd) throws Exception;

    /**
     * @Description 更新数据字典
     * @param commonCd
     * @return
     * @Author yjzhao
     * @Date 2019/9/23 20:11
     **/
    boolean update(CommonCd commonCd) throws Exception;

    /**
     * @Description 删除数据字典
     * @param childCd
     * @return
     * @Author yjzhao
     * @Date 2019/9/23 20:11
     **/
    boolean delete(String childCd) throws Exception;


}
